#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->pushButton_1, SIGNAL(clicked()), this, SLOT(func()));
    connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(func()));
    connect(ui->pushButton_3, SIGNAL(clicked()), this, SLOT(func()));
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::func()
{
    QObject *obj = sender();
    if(obj == ui->pushButton_1)
    {
        qDebug() << "1";
    }
    if(obj == ui->pushButton_2)
    {
        qDebug() << "2";
    }
    if(obj == ui->pushButton_3)
    {
        qDebug() << "3";
    }
    qDebug() << "func()";
}
